<template>
  <div>
    我是a1==={{$store.state.msg}}==={{count}}
    <br />
    <input type="text" v-model="count" />
    <button @click="btn1">点我</button>
    <button @click="btn2">dianwo</button>
  </div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
export default {
  methods: {
    ...mapMutations(["m1"]),
    btn1() {
      //   this.$store.commit("m1", 2);
      this.m1(2);
    },
    btn2() {
      this.$store.commit("m2", 2);
    },
  },
  computed: {
    ...mapState(["count"]),
  },
};
</script>
<style lang="less" scoped>
</style>